package com.cwnu.onlinemall.service;

import com.cwnu.onlinemall.mapper.MallCustomerMapper;
import com.cwnu.onlinemall.pojo.MallCustomer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class customerServiceImpl implements customerService{
    @Autowired
    MallCustomerMapper mallCustomerMapper;
    @Override
    public List<MallCustomer> selectAll() {
        return mallCustomerMapper.selectByExample(null);
    }

    @Override
    public MallCustomer selectById(Integer id) {
        return mallCustomerMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer deleteById(Integer id) {
        return mallCustomerMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Integer insertById(MallCustomer mallCustomer) {
        Integer row = mallCustomerMapper.insertSelective(mallCustomer);
        return row;
    }

    @Override
    public Integer updateById(MallCustomer mallCustomer) {
        Integer row = mallCustomerMapper.updateByPrimaryKeySelective(mallCustomer);
        return row;
    }
}
